<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
   
    function getNum(a, b) {
        if(a<b){
            var c = a;
            a = b ;
            b = c;
        }
        var r = a % b;
        a = b;
        b = r;
        return r === 0 ? a : getNum(a, b); 
    }
    console.log(getNum(45, 60))

</script>

</html>